﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Panel panel = new Panel();
            panel.BackColor = Color.Red;
            panel.Width = 200;
            panel.Height = 300;
            this.flowLayoutPanel1.Controls.Add(panel);
        }

        //初始化浏览器并启动
        public void InitializeAccountChromium()
        {

          

          var  AccountContext = new RequestContext(new RequestContextSettings()
            {
                CachePath = AppDomain.CurrentDomain.BaseDirectory + "caches\\global2\\",
                PersistSessionCookies = true,
                PersistUserPreferences = true
            });

            AccountChromeBrowser = new ChromiumWebBrowser("http://yangkeduo.com/", AccountContext);
#if DEBUG
            AccountChromeBrowser.KeyboardHandler = new CEFKeyBoardHander();
#endif
            this.uiPanel1.Controls.Add(AccountChromeBrowser);

            AccountChromeBrowser.Dock = DockStyle.Fill;
        }
    }
}
